import xlwings as xw
from xlwings.utils import rgb_to_int
app = xw.App(visible=False, add_book=False)
workbook = app.books.open('F:\\python\\第4章\\员工档案表.xlsx')
worksheet = workbook.sheets[0]
area = worksheet.range('A1').expand('table')
for i in range(7, 13):
    b = area.api.Borders(i)
    if i < 11:
        b.LineStyle = 1
        b.Weight = 4
        b.Color = rgb_to_int((0, 0, 255))
    else:
        b.LineStyle = -4115
        b.Weight = 2
        b.Color = rgb_to_int((255, 0, 255))
workbook.save('F:\\python\\第4章\\员工档案表1.xlsx')
workbook.close()
app.quit()
